package com.qianli.user.enums;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/3/16
 * Time: 下午8:37
 */
public enum TagTypeEnum {
    ALL(0, "所有"),
    THIRD_PART_DATA(1, "第三放数据"),
    CONTACT_AND_CARRIER(2, "通信录和运营商"),
    REAL_NAME(3, "实名相关"),
    COLLECTION(4, "催收"),
    AUDIT(5, "信审");

    private Integer type;

    private String desc;

    TagTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public Integer getType() {
        return type;
    }

    public TagTypeEnum setType(Integer type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public TagTypeEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static TagTypeEnum getEnumByType(Integer type) {
        TagTypeEnum userTagTypeEnum = null;
        for (TagTypeEnum u : TagTypeEnum.values()) {
            if (u.getType().equals(type)) {
                userTagTypeEnum = u;
            }
        }

        return userTagTypeEnum;
    }

    public static List<TagTypeEnum> getEnums(){
        List<TagTypeEnum> userTagTypeEnumList = new ArrayList<>();
        for (TagTypeEnum userTagTypeEnum : TagTypeEnum.values()){
            userTagTypeEnumList.add(userTagTypeEnum);
        }
        return userTagTypeEnumList;
    }

}
